// 函数的形参和实参

#include <iostream>

// This function takes no parameters
// It does not rely on the caller for anything
void doPrint()
{
    std::cout << "In doPrint()\n";
}

// This function takes one integer parameter named x
// The caller will supply the value of x
void printValue(int x)
{
    std::cout << x  << '\n';
}

// This function has two integer parameters, one named x, and one named y
// The caller will supply the value of both x and y
int add(int x, int y)
{
    return x + y;
}


void doSomething(int count) // warning: unreferenced parameter count
{
    // This function used to do something with count but it is not used any longer
}
void doSomething2(int) // ok: unnamed parameter will not generate warning
{
}
// 当函数参数存在但未在函数体中使用时，不要给它命名。可以选择在注释中放入一个名称。
void doSomething3(int /*count*/)
{
}

int main() {
    doPrint(); // this call has no arguments
    printValue(6); // 6 is the argument passed to function printValue()
    add(2, 3); // 2 and 3 are the arguments passed to function add()


    doSomething(4);

    return 0;
}